import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'Index',
          component: ()=>import('@/view/Index.vue'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/exam',
          name: 'Exam',
          component: ()=>import('@/view/Exam.vue'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/examedit',
          name: 'examedit',
          component: ()=>import('@/view/examedit.vue'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/studata',
          name: 'studata',
          component: ()=>import('@/view/Studata.vue'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/dataview',
          name: 'dataview',
          component: ()=>import('@/view/Dataview.vue'),
          meta: {
            requireAuth: true
          }
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: ()=>import('@/view/Login.vue')
    }
  ]
})
